import {
	request,
} from '@/api/request';
const apiList = [{
		// 验证码登录
		name: 'register',
		url: '/api/user/register'
	},
	{
		// 短信发送
		name: 'smssend',
		url: '/api/sms/send'
	},
	{
		// /api/user/getopenid
		name: 'getopenid',
		url: '/api/user/getopenid',
		method:'GET'
	},
	{
		// /api/user/getWechatPhone
		name: 'getWechatPhone',
		url: '/api/user/getWechatPhone',
		method:'GET'
	},
	{
		// /api/user/profile
		name: 'profile',
		url: '/api/user/profile'
	},
	{
		// /api/user/index
		name: 'userinex',
		url: '/api/user/index'
	},
	{
		// /api/user/myChargeRecord
		name: 'myChargeRecord',
		url: '/api/user/myChargeRecord',
		method:'GET'
	},
	{
		// /api/user/findInfo
		name: 'findInfo',
		url: '/api/user/findInfo',
		method:'GET'
	},
	{
		// /api/user/getUserInfo
		name: 'getUserInfo',
		url: '/api/user/getUserInfo',
		method:'GET'
	},{
		// /api/user/myInfo
		name: 'myInfo',
		url: '/api/user/myInfo',
		method:'GET'
	},
	{
		// /api/user/myCollect
		name: 'myCollect',
		url: '/api/user/myCollect',
		method:'GET'
	},
	{
		// /api/user/myChargeRecord
		name: 'myChargeRecord',
		url: '/api/user/myChargeRecord',
		method:'GET'
	},
	{
		// /api/user/ourNotifyCount
		name: 'ourNotifyCount',
		url: '/api/user/ourNotifyCount',
		method:'GET'
	},
	{
		// /api/user/infoContentCount
		name: 'infoContentCount',
		url: '/api/user/infoContentCount',
		method:'GET'
	},
	{
		// /api/user/readNotify
		name: 'readNotify',
		url: '/api/user/readNotify'
	},
	{
		// /api/user/myRate
		name: 'myRate',
		url: '/api/user/myRate',
		method:'GET'
	},
	{
		// /api/user/moneyLogList
		name: 'moneyLogList',
		url: '/api/user/moneyLogList',
		method:'GET'
	},
	{
		// /api/user/updateRate
		name: 'updateRate',
		url: '/api/user/updateRate'
	},
	{
		// /api/index/submitWithdraw?price
		name: 'submitWithdraw',
		url: '/api/index/submitWithdraw'
	}
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token
	})
	return mode
}, {})